//import Vue from 'vue'
import App from './App'
import { createSSRApp } from 'vue'
import store from '@/store/store.js'
import uView from './uni_modules/vk-uview-ui';


// 导入网络请求的包
import { $http } from '@escook/request-miniprogram'
uni.$http = $http
// 封装弹框的方法
uni.$showMsg = function(title = '数据请求失败！', duration = 1500) {
  uni.showToast({
    title,
    duration,
    icon: 'none'
  })
}
// 请求的根路径
// $http.baseUrl = 'https://campusstyle.site:8982'
// $http.wsUrl = 'wss://campusstyle.site:8982/websocket/'
$http.baseUrl = 'http://127.0.0.1:8982'
$http.wsUrl = 'wss://127.0.0.1:8982/websocket/'





//Pinia
import * as Pinia from 'pinia';
export function createApp() {
    const app = createSSRApp(App)
	 app.use(Pinia.createPinia());
	app.use(store);// 使用store
	 // 使用 uView UI
	  app.use(uView);
    return {
        app	,
		Pinia,
    }
}